﻿// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using Newtonsoft.Json.Linq;
using BuscoPre;

namespace BuscoPre.Repository.MLA.JsonTypes
{

    public class Value
    {

        private JObject __jobject;
        public Value(JObject obj)
        {
            this.__jobject = obj;
        }

        public string Id
        {
            get
            {
                return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "id"));
            }
        }

        public string Name
        {
            get
            {
                return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "name"));
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private PathFromRoot[] _pathFromRoot;
        public PathFromRoot[] PathFromRoot
        {
            get
            {
                if(_pathFromRoot == null)
                    _pathFromRoot = (PathFromRoot[])JsonClassHelper.ReadArray<PathFromRoot>(JsonClassHelper.GetJToken<JArray>(__jobject, "path_from_root"), JsonClassHelper.ReadStronglyTypedObject<PathFromRoot>, typeof(PathFromRoot[]));
                return _pathFromRoot;
            }
        }

    }
}
